//
//  CRMListTableViewCell.m
//  XinKaiFa55like
//
//  Created by 55like on 2017/9/23.
//  Copyright © 2017年 55like lj. All rights reserved.
//

#import "CRMListTableViewCell.h"

@implementation CRMListTableViewCell

//联系人
-(void)setModel:(ListModel *)model{
    
    self.titlelab.text = model.name;
    self.titlelab.frame = CGRectMake(10, 10, [model.name widthWithFont:14], 12);
    self.icon.frame = CGRectMake(XW(self.titlelab) + 10, YH(self.titlelab) - 27/2, 11, 27/2);
    self.icon.image = [UIImage imageNamed:@"xkf_ntb"];
    self.deslab.text = model.companyname;
    self.deslab.frame = CGRectMake(10, YH(self.titlelab) + 8, [model.companyname widthWithFont:14], 12);
    
    if ([model.sex isEqualToString:@"2"]) {
        
         self.icon.image = [UIImage imageNamed:@"xkf_25nv"];
        
    }else if ([model.sex isEqualToString:@"1"]) {
        
        self.icon.image = [UIImage imageNamed:@"xkf_ntb"];
        
    }else{
        
        self.icon.image = [UIImage imageNamed:@""];
        
    }
   

    
}
//重要客户
-(void)setKetmodel:(KeylistModel *)ketmodel{
    
    self.titlelab.text = ketmodel.name;
    self.titlelab.frame = CGRectMake(10, 10, [ketmodel.name widthWithFont:14], 12);
    self.icon.frame = CGRectMake(XW(self.titlelab) + 10, YH(self.titlelab) - 27/2, 11, 27/2);
    self.icon.image = [UIImage imageNamed:@"xkf_ntb"];
    self.deslab.text = ketmodel.companyname;
    self.deslab.frame = CGRectMake(10, YH(self.titlelab) + 8, [ketmodel.companyname widthWithFont:14], 12);
    
    if ([ketmodel.sex isEqualToString:@"2"]) {
        
        self.icon.image = [UIImage imageNamed:@"xkf_25nv"];
        
    }else if ([ketmodel.sex isEqualToString:@"1"]) {
        
        self.icon.image = [UIImage imageNamed:@"xkf_ntb"];
        
    }else{
        
        self.icon.image = [UIImage imageNamed:@""];
    }
    
}



-(UILabel *)titlelab{
    
    if (!_titlelab) {
        
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTitleDeepGray;
        lab.font = Font(14);
        lab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:lab];
        _titlelab = lab;
        
        
    }
    
    return _titlelab;
}
-(UILabel *)deslab{
    
    if (!_deslab) {
        
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTxtGray;
        lab.font = Font(14);
        lab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:lab];
        _deslab = lab;
        
        
        
    }
    
    return _deslab;
}
-(UIImageView *)icon{
    
    if (!_icon) {
        
        UIImageView * imageview = [[UIImageView alloc]init];
        imageview.clipsToBounds = YES;
        [self addSubview:imageview];
        _icon = imageview;
    }
    
    return _icon;
}

@end
